import friendApi from '@/api/friend.js'
/** 
 * 自动添加好友
 * @param {*} key 
 */
export function useAddAutoFirend(key) {
	let local = uni.getStorageSync(key)
	if (local) {
		let data = {
			user_id: local,
			remark: ''
		}
		friendApi.addNoApply(data).then((res) => {
			if (res.code === 0) {
				console.log('自动添加好友成功' + local);
				uni.removeStorageSync(key)
			}

		}).catch(() => {
			console.log('自动添加好友失败' + local);
		})
	}
}